<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Yingruan" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1,user-scalable=0" name="viewport" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-title" content="foodie">
<title>yhofoodie</title>
<script>
	var htphref2=window.location.href,htp2="";
	if(htphref2.indexOf("https")!=-1){
		htp2="https://"
	}else{
		htp2="http://"
	}
    document.write("<script type='text/javascript' src='"+ htp2 +"api.foodie.vc/JS_config/config.js?" + Math.random() + "'></scr" + "ipt>");
</script>
<link rel="stylesheet" href="css/common.css" />
<script type='text/javascript' src='js/jquery.js?003'></script>
<script type='text/javascript' src='js/function.js?003'></script>
<script type='text/javascript' src='js/vue.min.js?003'></script>
<script type='text/javascript' src='js/jquery-weui/jquery-weui.js'></script>
<link rel="stylesheet" href="js/jquery-weui/jquery-weui.css" />
<link rel="stylesheet" href="js/jquery-weui/weui.min.css" />
<style>
	.weui-dialog__hd{ padding: 0; }
</style>
<script>	
	var lange={}
	var mainfalse=false;
    var navlange=navigator.language.toLowerCase().substr(0, 2)
	var langarr=["zh","en","ms"]
	if(langarr.indexOf(navlange)==-1) navlange="en"
    if(getCookie("language")=="null"){setCookie("language", navlange, 30);};
    document.write("<script type='text/javascript' src='/js/cacheControl.config.js?" + Math.random() + "'></scr" + "ipt>");
</script>

<script>
	 function back(){
    	var ws = plus.webview.currentWebview()
			plus.webview.close(ws.id)
    }
	 if(navigator.userAgent.match(/Html5Plus/i)){
	 	document.addEventListener('plusready', plusReady1, false);
	 	
	 }
	 function plusReady1(){
	 	plus.key.addEventListener("backbutton", function(){
	 		var ws = plus.webview.currentWebview()
			plus.webview.close(ws.id)
	 	}, false);
	 }
	//设置ajaxhead
    //delCookie("huanzhuo");
    var mem_id = getCookie("yingsoft_home_member_id");
	
	//用于微信登录获取memberID
	if(getUrlParam2("member_id")){
    	mem_id=getUrlParam2("member_id")
    }
	mem_id == "null" ? mem_id = 0 : 0;
	$(function(){
		 $.ajax({
		    type: "post",
		    dataType: "json",
		    url: jsonpath + "put_member_login",
		    data: {
		        shop_id: getUrlParam2("shop_id"), shop_table_id: getUrlParam2("shop_table_id"), member_id: mem_id
		    },
		    cache: false,
		    success: function (obj) {
		    	
		    	if(obj.status==1)
            	{
            		$.each(obj.result, function (v, i) {
			        	console.log(v)
			            //setCookie(v, i, 3650);
			           // localStorage.item(v,i)
			        })
			        $.ajax({
					    type: "post",
					    dataType: "json",
					    url: jsonpath + "get_order_pay_url",
					    data: {sn:getUrlParam2("sn")},
				        headers: {
				            "MEMBER-ENCODE": obj.result.yingsoft_home_encode,
				            "SHOP-ENCODE": obj.result.yingsoft_home_shop_encode   
				        },
					    cache: false,
					    success: function (obj2) {
					    	if(obj2.status==1)
			            	{
			            		 //window.location.href=obj2.result.url;
			            		 pack_box.obj=obj2.result;
			            		 pack_box.open=1;
			            		 
			            	}else{
			            		$.alert(obj2.msg)
			            	}
					       
					    },
					    error:function () {
					        alert("Loading error");
					    }
					});
            	}else{
            		$.alert(obj.msg)
            	}
		        
		    },
		    error:function () {
		        alert("Loading error");
		    }
		});
		
		var newlange={
			"zh":{
				001:"名称",
				002:"数量",
				003:"金额",
				004:"菜价",
				005:"服务费",
				006:"消费税",
				007:"总金额",
				008:"支付",
				'009':"付款单",
				'010':"待支付",
				'011':"已支付"
			},
			"en":{
				001: "name",
				002: "Quantity",
				003: "Amount",
				004: "Vegetable price",
				005: "Service fee",
				006: "Consumption Tax",
				007: "Total amount",
				008: "Payment",
				'009':"Receipt",
				'010':"To be paid",
				'011':"Paid"
			},
			"ms": {
				001: "nama",
				002: "Kuantiti",
				003: "Jumlah",
				004: "Harga sayuran",
				005: "Yuran perkhidmatan",
				006: "Cukai Penggunaan",
				007: "Jumlah amaun",
				008: "Pembayaran",
				'009':"Slip pembayaran",
				'010':"Pending pembayaran",
				'011':"Dibayar"
			}

		}
		//新的语言包
		var curlanguage = getCookie("language")=="zh"?"简体中文":(getCookie("language")=="en"?"English":"Melayu");
	    //套餐选择
		var pack_box = new Vue({
		  el: '#play1',
		  data: {
		    lange: getCookie("language"),//全局语言
		    obj:{},
		    curlanguage:curlanguage,
			popFlag:1,
		    open:0,
		    newlange:newlange,
		    pathUrl:""
		  },
		  created: function () {
//		  	this.init();
		  },
		  mounted:function(){
		  	
		  },
		  methods:{
		  	init:function(e){//初始化
		  		if (pack_box.lange == "zh") {
					pack_box.curlanguage = "简体中文";
				}else if (pack_box.lange == "en") {
					pack_box.curlanguage = "English";
				}else if (pack_box.lange == "ms") {
					pack_box.curlanguage = "Melayu";
				}
				pack_box.pathUrl = pack_box.obj.url.substr(0,pack_box.obj.url.indexOf("&l="))+"&l="+pack_box.lange;
//				$("input[name=title]").attr({"data-error":yuyan[pack_box.lange]['003'],"placeholder":yuyan[pack_box.lange]['003']});
//				$("input[name=mobile]").attr({"data-error":yuyan[pack_box.lange]['005'],"placeholder":yuyan[pack_box.lange]['005']});
//				$("input[name=email]").attr({"data-error":yuyan[pack_box.lange]['019'],"placeholder":yuyan[pack_box.lange]['007']});
		  	},
		  	sureLanguage: function (l,ele) {
				pack_box.lange = l;
				this.init();
				pack_box.popFlag = 1;
			},
			changeLanguage: function (ele) {
				pack_box.popFlag = 2;
			}
		  }
		})
		//套餐end
			
		
		
	})
</script>
<style>
	body{ font-size: 14px;}
	*{ margin: 0; padding: 0;}
	.titles{    width: 100%;  font-size: 20px; left: 0; top: 0;   position: fixed;  text-align: center;   height: 50px;    line-height: 50px;  background: #fff;   border-bottom: 1px solid #e9e9e9;    z-index: 999;}
	.order-mode table{ width: 100%; border-collapse:collapse; border-spacing:0}
	.order-mode table td{ border: 1px solid #ddd; padding: 5px;}
	.bottoms1{width: 100%;  font-size: 20px; left: 0; bottom: 0;   position: fixed;  text-align: center;   background: #333333;     z-index: 999;}
	.bottoms1 .bon{ background: #d73119; color: #fff; min-width: 30%;}
	.language { border: 1px solid #ccc; border-radius: 30px; position: absolute;right: 12px;}
	.language .lang { width: 70px; box-sizing: border-box;}
	.language .pop { position: absolute; top: 30px; border-top: 1px solid transparent; line-height: 2em; display: none; border: 1px solid #ccc; border-radius: 4px; width: 90%; left: 5%;}
	.language .pull_img { width: 7px;}
	.language .pop li{ padding: 2px 10px; border-bottom: 1px solid #ccc;}
	.language .pop li:active{ background-color: #c1c1c1;}
	.language .pop li:last-child{ border: none;}
	.language #showLanguage { min-width: 50px;padding: 10px;padding-bottom: 5px;padding-top: 5px; font-size: 12px;}
	.triangle{ border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 5px solid #ccc;}
	.pad-b-30 { padding-bottom: 30px;}
	.pad-t-30 { padding-top: 30px;}
	.f-12 { font-size: 12px;}
	.titles{position: relative;}
	.titles-back{position: absolute; left: 10px; display: block; width: 30px; height:25px; margin: auto; top: 0; bottom: 0; background:url(images/back2.png); background-size:100% 100%;}
</style>
</head>
<body>
	<div class="list" id="play1" v-if="open==1" v-cloak>
		<div class="titles"><div class="titles-back" onclick="back()"></div>{{newlange[lange]['009']}}</div>
		<div class="order-mode">
			<!--语言切换-->
        	<!--<div class="pad-b-30 pad-t-30" style="position: relative;">
				<div class="language col-sm-3">
					<div id="bbb" class="fiex" @click="changeLanguage(this)">
						<div id="showLanguage">{{curlanguage}}
						</div>
						<div id="aaa">
							<div class="triangle"></div>
						</div>
					</div>
					<ul class="pop bg-fff f-12" style="display: block;" v-if="popFlag==2">
						<li @click="sureLanguage('zh',this)">简体中文</li>
						<li @click="sureLanguage('en',this)">English</li>
						<li @click="sureLanguage('ms',this)">Melayu</li>
					</ul>
				</div>
			</div>-->
			
        	<div class="car-ul order-art-list" style="padding-top: 0;">          	
                <div class="item-l f-30  pad-20 center" id="item-l-10845465867807" data-goods_id="2827" data-cart_id="10845465867807">
	                <table>   
	                    <thead>
	                		<tr>
			        			<td class="td1" width="15%"><div class="w">.No</div></td>
			        			<td class="td2"><div class="w" >{{newlange[lange][001]}}</div></td>
			        			<td class="td3" style="width: 20%;"><div class="w" >{{newlange[lange][002]}}</div></td>
			        			<td class="td4" width="20%"><div class="w" >{{newlange[lange][003]}}</div></td>
			        		</tr>
	                	</thead>
	                   <tbody>
		                   	<tr class="item" v-for="(v,i,index) in obj.order_goods_list">
				            	<td class="td1"><div class="w center">{{index+1}}</div></td>
				    			<td class="td2">
				    				<div class="w ">
										<span>{{v.goods_name.indexOf("[") == -1?v.goods_name:v.goods_name.substr(0,v.goods_name.indexOf("["))}}</span>
					    			</div>
				    			</td>
				    			<td class="td3" style="width: 18%;"><div class="w center bon">
				    				 <span class="g3  red">{{v.count}}</span>
				    			</div></td>
				    			<td class="td4"><div class="w center red">{{v.goods_total_price}}</div></td>
				            </tr>
	            		</tbody>
	                </table>
		        </div>
            </div>
	    <div class="line-ddd mag-t-20"></div>
		<div class="order-bon pad-20">
			<div class="cf fiex">
				<div class=" f-28 pad-l-10 f-left" style="line-height: 1.3;">
					<p><span data-l="1197">{{newlange[lange][004]}}</span> <span class="red">{{obj.order_info.goods_total_price}}</span></p>
					<p><span data-l="1198">{{newlange[lange][005]}}</span> <span class="red">{{obj.order_info.tax_service_price}}</span></p>
					<p><span data-l="1199">{{newlange[lange][006]}}</span> <span class="red">{{obj.order_info.tax_excise_price}}</span></p>
				</div>
				<div class="fiex1 order-price  f-34 f-right" style="line-height: 1;">
		            <!--<i data-l="1024">{{newlange[lange][007]}}</i>：<span class="sum f-40 red">{{obj.order_info.total_price}}</span>-->
		             <i v-if="obj.order_info.free">{{newlange[lange]['011']}}:</i><span v-if="obj.order_info.free" class="sum f-40 red">{{obj.order_info.free}}</span>
		             <i>{{newlange[lange]['010']}}</i>：<span class="sum f-40 red">{{obj.order_info.pay_price}}</span>
		        </div>
			</div>
	    </div>
	    
	    <div class="bottoms1 fiex ">
	    	<div class="fiex1 f-left"><span class="f-50 pad-l-20 " style="color: #fff;">{{obj.order_info.total_price}}</span></div>
	    	<a class="bk bon pad-30 f-40" :href="obj.url.substring(0,obj.url.indexOf('&l='))+'&l='+lange">
	    		<span>{{newlange[lange][008]}}</span>
	    	</a>
	    </div>
		
		</div>
	</div>
</body>

</html>
